import com.alibaba.fastjson.JSONObject;
import com.duzq.ws.*;

public class MainTest {
    public static void main(String[] args) throws Exception {
        // 1. 相当于初始化对象
        WebServiceDemoService wsd = new WebServiceDemoServiceLocator();

        // 2. 获取可以用于请求 WebService 的对象
        WebServiceDemo wsdPort = wsd.getWebServiceDemoPort();

        // 3. 简单接口调用示例
        String demo1Res = wsdPort.demo1("简单调用测试");
        System.out.println("demo1 请求结果：" + demo1Res);

        // 4. 正常接口调用示例
        OrderInfo reqOrderInfo = new OrderInfo();
        reqOrderInfo.setOrderId(1);

        WebServiceRequest request = new WebServiceRequest();
        request.setOrderInfo(reqOrderInfo);

        System.out.println("getOrderInfo##req##" + JSONObject.toJSONString(request));
        WebServiceResponse response = wsdPort.getOrderInfo(request);
        System.out.println("getOrderInfo##res##" + JSONObject.toJSONString(response));
    }
}
